package com.walter.entity;

import com.baomidou.mybatisplus.enums.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableName;
import java.io.Serializable;


import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * <p>
 * 用户表
 * </p>
 *
 * @author ch
 * @since 2021-05-25
 */
@Data
@Accessors(chain = true)
@TableName("sys_user")
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "用户表", subTypes = {User.class})
public class User extends Model<User> {

    private static final long serialVersionUID = 1L;


    @ApiModelProperty(value = "用户表主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "用户名")
    @TableField("user_name")
    private String userName;

    @ApiModelProperty(value = "密码")
    private String password;

    @ApiModelProperty(value = "创建时间")
    @TableField("create_time")
    private Date createTime;

    @ApiModelProperty(value = "最后修改密码时间")
    @TableField("last_update_pass_time")
    private Date lastUpdatePassTime;

    @ApiModelProperty(value = "修改时间")
    @TableField("update_time")
    private Date updateTime;

    @ApiModelProperty(value = "昵称")
    @TableField("nick_name")
    private String nickName;

    @ApiModelProperty(value = "邮箱")
    private String email;

    @ApiModelProperty(value = "头像URL")
    private String avatar;

    @ApiModelProperty(value = "性别 man男woman女")
    private String gender;

    @ApiModelProperty(value = "qq")
    private String qq;

    @ApiModelProperty(value = "密码盐")
    private String salt;

    @ApiModelProperty(value = "是否启用")
    @TableField("is_enabled")
    private String isEnabled;


    public static final String ID = "id";

    public static final String USER_NAME = "user_name";

    public static final String PASSWORD = "password";

    public static final String CREATE_TIME = "create_time";

    public static final String LAST_UPDATE_PASS_TIME = "last_update_pass_time";

    public static final String UPDATE_TIME = "update_time";

    public static final String NICK_NAME = "nick_name";

    public static final String EMAIL = "email";

    public static final String AVATAR = "avatar";

    public static final String GENDER = "gender";

    public static final String QQ = "qq";

    public static final String SALT = "salt";

    public static final String IS_ENABLED = "is_enabled";

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
